import { Application } from "egg";

export default (app: Application) => {
  const { controller, router } = app;
  // 路由中间件
  // const Logger = app.middleware.myLogger(
  //   {
  //     allowMethod: ["GET"],
  //   },
  //   app
  // );

  // router.get("/", controller.home.index);
  // router.get("/test/:id", controller.test.index);
  // router.post("/test/:id", controller.test.index);
  // router.get("/dog", Logger, controller.test.getDog);

  router.post("/api/users/create", controller.user.createByEmail);
  router.get("/api/users/current", controller.user.show);
  router.post("/api/users/login", controller.user.loginByEmail);

  router.post("/api/utils/upload", controller.utils.testBusBoy);

  router.post("/api/utils/upload-img", controller.utils.uploadMutipleFiles);
  router.get("/api/pages/:idAdUuid", controller.utils.renderH5Page);
};
